** This arexx script will import the currently loaded image in SuperView
** into Image Engineer. Both programs must be running at the same time.
** This script was developed to work with SuperView 5.70 and
** Image Engineer 3.3.
**
*/
OPTIONS RESULTS
SIGNAL ON ERROR
TEMP_FILE = 't:Image_from_SV'
PORT = 'SuperView.rx'
/* Main code */
IF ~SHOW('P',PORT) THEN DO
'REQUEST' '"Could not locate SuperView'x2c(27)'s arexx port!"' '" OK "'
CALL ErrorOut 0
END
ADDRESS VALUE PORT
'SAVE_TYPE=ILBM CmpByteRun1'
'SAVE=' || TEMP_FILE
IF (RC ~= 0) THEN DO
ADDRESS 'IMAGEENGINEER'
'IE_TO_FRONT'
'REQUEST' '"Error when saving image from SuperView!"' '" OK "'
CALL ErrorOut 10
END
ADDRESS 'IMAGEENGINEER'
'OPEN' '"'TEMP_FILE'"' '24'
IF (RC ~= 0) THEN DO
'REQUEST' '"Error when loading image into IE!"' '" OK "'
CALL ErrorOut 10
END
'IE_TO_FRONT'
CALL ErrorOut 0
/* Errorout procedure ----------------------- */
ErrorOut:
PARSE ARG ExitCode
IF (EXISTS( TEMP_FILE )) THEN DO
ADDRESS COMMAND "Delete >NIL:" TEMP_FILE
END
EXIT ExitCode
/* IE's error procedure --------------------- */
Error:
if RC=5 then do
'IE_TO_FRONT'
'LAST_ERROR'
'REQUEST "'||RESULT||'"'
end
else do
'IE_TO_FRONT'
'LAST_ERROR'
'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'